package DAO.impl;

import DAO.BankDAO;
import DAO.BaseDao;
import bean.Bank;
import sun.security.jca.GetInstance;

import java.sql.Connection;

/**
 * @author 栋
 * @date 2022/11/25
 * @description
 */
public class BankDAOImpl extends BaseDao<Bank> implements BankDAO {
    @Override
    public Bank getCreditByNumber(Connection conn,String number) {
        String sql="select * from bank where credit_number=?";
        return getInstance(conn,sql,number);
    }

    @Override
    public void updateCard(Connection conn, Bank card) {
        String sql="update bank set money=? where credit_number=?";
        update(conn,sql,card.getMoney(),card.getCredit_number());
    }
}
